Skip to content

feat: add toggle to send only the user's dictation prompt without the forced base prompt#464

Merged
grohith327 merged 1 commit into
altic-dev:mainfrom
mvanhorn:fix/307-dictation-prompt-override-toggle
Jul 11, 2026
Merged

feat: add toggle to send only the user's dictation prompt without the forced base prompt#464
grohith327 merged 1 commit into
altic-dev:mainfrom
mvanhorn:fix/307-dictation-prompt-override-toggle

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a sendCustomPromptOnly toggle so AI Enhancement sends only the user's custom dictation prompt, without the forced base prompt prepended. This matches the "yolo toggle" approach @grohith327 endorsed on the issue: the resolution point is SettingsStore's prompt composition, routed through a new systemPrompt(forCustomProfileBody:mode:) helper. Default behavior is unchanged; the base prompt is only dropped when the toggle is on.

Adds request-body tests covering both toggle states.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Closes #307

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 26.3
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources (0 violations)
  • Ran formatter locally: swiftformat --config .swiftformat Sources (files touched by this PR are clean; remaining repo-wide drift is pre-existing)
  • Ran tests locally: request-body tests for both toggle states are included in the PR; the suite runs in CI

Screenshots / Video

The new toggle in AI Enhancement > Advanced Prompts:

Off (default, unchanged behavior):

Send Custom Prompt Only - off

On:

Send Custom Prompt Only - on

Notes

The toggle only affects custom Dictate prompts; the built-in default prompt path is untouched. Built and ran this branch locally on Apple Silicon to capture the screenshots above.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if enabled {
let combined = self.viewModel.combinedDraftPrompt(self.viewModel.draftPromptText, mode: self.viewModel.draftPromptMode)
self.promptTest.activate(draftPromptText: combined)

P2 Badge Apply the custom-only toggle in prompt test mode

When test mode is enabled from a Dictate prompt editor, the draft prompt is still passed through combinedDraftPrompt, which always prepends the built-in base prompt and does not consult sendCustomPromptOnly. With the new toggle on, the test request therefore exercises a different prompt than the one this setting is meant to send, so users can get misleading test output before saving or using the prompt.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1202 to +1203
if normalizedMode == .dictate, self.sendCustomPromptOnly {
return trimmedBody

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor custom-only prompts on the recording path

When a user enables this toggle and selects a custom Dictate prompt for the primary or secondary shortcut, the live recording path never reaches this new helper: applyDictationShortcutSelectionContext builds promptModeOverrideText with SettingsStore.combineBasePrompt(...) (ContentView.swift:3399-3402), and processTextWithAI prefers that non-empty overrideSystemPrompt before calling buildSystemPrompt (ContentView.swift:1819-1822). In that common selected-profile scenario, the built-in base prompt is still prepended even though sendCustomPromptOnly is true, so the advertised feature only works for paths that resolve through SettingsStore directly, such as app-bound profiles.

Useful? React with 👍 / 👎.

Comment on lines +342 to +346
var sendCustomPromptOnly: Bool {
get { self.defaults.bool(forKey: Keys.sendCustomPromptOnly) }
set {
objectWillChange.send()
self.defaults.set(newValue, forKey: Keys.sendCustomPromptOnly)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve custom-only prompt setting in backups

This new persisted setting is not included in SettingsBackupPayload/settingsBackupPayload() and restore(from:) never reads it back, so exporting and importing a backup silently resets the toggle to the default false. For users who rely on custom-only Dictate prompts, a restored machine will start prepending the built-in base prompt again even though their prompt profiles and selections were restored.

Useful? React with 👍 / 👎.

@grohith327

Copy link
Copy Markdown
Collaborator

@mvanhorn Can you update the PR description in the new template and also add screenshots/video for testing

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Done - the description now follows the PR template, and I added before/after screenshots of the new Send Custom Prompt Only toggle in the AI Enhancement > Advanced Prompts pane (built and ran the branch locally on macOS 26.3 to capture them).

@grohith327

Copy link
Copy Markdown
Collaborator

@greptileai review

@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a sendCustomPromptOnly toggle to AI Enhancement that, when enabled, sends only the user's custom Dictate prompt without prepending the built-in base dictation prompt. Default behavior is unchanged; the base prompt is still prepended unless the toggle is explicitly turned on.

  • Adds sendCustomPromptOnly to SettingsStore and a private systemPrompt(forCustomProfileBody:mode:) helper that gates the base-prompt composition, correctly wired into all named-profile and app-binding code paths in promptResolution and effectiveDictationSystemPrompt.
  • Adds the toggle row to the Advanced Prompts routing-scope section for Dictate mode, and adds a read-only base-prompt reference panel in the prompt editor for context.
  • Adds four integration tests covering toggle-on, toggle-off, built-in default unchanged, and per-app binding behavior.

Confidence Score: 4/5

Safe to merge; the core toggle logic is correctly implemented across all user-facing prompt paths.

The new helper is wired into every named-profile and app-binding path. The one gap is the defaultDictationPromptOverride branch in defaultPromptResolution, which still calls combineBasePrompt directly, so a backup-restored prompt override silently ignores the toggle. This path is not exposed through the UI and is unlikely to affect users in practice, but the inconsistency is real.

SettingsStore.swift — specifically the defaultDictationPromptOverride branch inside defaultPromptResolution where it constructs the PromptResolution with a hard-coded combineBasePrompt call.

Comments Outside Diff (1)

  1. Sources/Fluid/Persistence/SettingsStore.swift, line 1178-1185 (link)

    P2 The defaultDictationPromptOverride path in defaultPromptResolution still calls Self.combineBasePrompt directly instead of the new systemPrompt(forCustomProfileBody:mode:) helper. If a user's backup contains a defaultDictationPromptOverride and they enable sendCustomPromptOnly, that override will still have the base prompt prepended — inconsistently with how named profiles behave through the same toggle.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: Sources/Fluid/Persistence/SettingsStore.swift
    Line: 1178-1185
    
    Comment:
    The `defaultDictationPromptOverride` path in `defaultPromptResolution` still calls `Self.combineBasePrompt` directly instead of the new `systemPrompt(forCustomProfileBody:mode:)` helper. If a user's backup contains a `defaultDictationPromptOverride` and they enable `sendCustomPromptOnly`, that override will still have the base prompt prepended — inconsistently with how named profiles behave through the same toggle.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Codex

Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
Sources/Fluid/Persistence/SettingsStore.swift:1178-1185
The `defaultDictationPromptOverride` path in `defaultPromptResolution` still calls `Self.combineBasePrompt` directly instead of the new `systemPrompt(forCustomProfileBody:mode:)` helper. If a user's backup contains a `defaultDictationPromptOverride` and they enable `sendCustomPromptOnly`, that override will still have the base prompt prepended — inconsistently with how named profiles behave through the same toggle.

```suggestion
            let body = Self.stripBasePrompt(for: mode, from: trimmedOverride)
            return PromptResolution(
                source: source,
                profile: nil,
                appBinding: appBinding,
                promptBody: body,
                systemPrompt: self.systemPrompt(forCustomProfileBody: body, mode: mode)
            )
```

Reviews (1): Last reviewed commit: "feat: add toggle to send only the user's..." | Re-trigger Greptile

@grohith327 grohith327 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@grohith327 grohith327 merged commit 58ed8df into altic-dev:main Jul 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞 BUG] Static dictation prompt for AI Enhancements sent with user's added prompt

2 participants